package cn.zzuisa.news.util;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * @ClassName:     TimeStamp2DateTime.java
 * @Description:   TODO 
 * @author        	zzuisa
 * @version         V1.0  
 * @Date           2018年9月11日 上午10:01:23 
 */
public class DateUtil {
	public static String stampToDate(String s){
        String res;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long lt = new Long(s);
        Date date = new Date(lt);
        res = simpleDateFormat.format(date);
        return res;
    }
	 public static String dateToStamp(String s) throws Exception{
	        String res;
	        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	        Date date = simpleDateFormat.parse(s);
	        long ts = date.getTime();
	        res = String.valueOf(ts);
	        return res;
	    }
}
